package org.android.brasil.projetos.oktoberfest2011.view.controller;

import org.android.brasil.projetos.oktoberfest2011.R;
import org.android.brasil.projetos.oktoberfest2011.utils.ControleDeBackground;
import org.android.brasil.projetos.oktoberfest2011.view.ComidaBebidaAdapter;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;

/**
 * @author douglas.alipio@gmail.com
 * 
 */
public class BebidaComidaController extends ListActivity {

	private static final String[] itens = {

		
		"Bebidas",
		"Água - 500 ml",		
		"Cervejas",
		"Chopp - 400 ml",

		"H2OH - 500 ml",
		"Refrigerante - 300 ml",
		
		
		"Comidas",
		"Bolinho de Carne",
		"Cachorro Quente",
		"Café da Tarde - Colonial",
		"Codorna Recheada",
		"Croquete de Carne",
		"Eisbein mit sauetinrr kraut - Joelho de porco",
		"Entensnack - Tulipa de Pato",
		"Ente Kroketten - Croquete de Pato",
		
		"Galeto a Oktoberfest",
		"Gefüllte Kartoffeln - Batata Recheada",
		"Gefulltes Entenbein - Coxa de marreco recheada",
		
		"Goulash Im Brot - Carnes variadas ao molho no pão",
		"Hackepeter - Carne moída crua temperada",
		"Kälbs medailon sauce meerretich - medalhão de mignon",
		"Kassler - Bistecas ou costeletas de porco defumadas",
		"Gebratkene ente - Marreco",
		"Pastel",
		"Picanha ou Medalhão ao Molho De Chopp",
		"Salsicha Completa",
		"Schweinebraten mit pflaumen und äpfel - Lombo suíno recheado",
		"Strudel - Torta de massa folhada com recheio",
		"Wiener Schnitzel - Carne Empanada",
		"X-Picanha ou X Alemão"
		};

	private static final String[] precos = {
		"",
		"R$ 3,00",
		"De R$ 6,00 a R$ 10,00",
		"R$ 4,50",
		"R$ 3,50",		
		"R$ 3,00",
		
		
		"",
			
		"R$ 12,00",
		"De R$ 6,00 a R$ 8,00",
		"R$ 18,00",
		"De R$ 8,00 a R$ 10,00",
		"R$ 12,00",
		"R$ 26,00",
		"R$ 12,00",
		"R$ 12,00",
		"De R$ 23,00 a R$ 26,00",
		"De R$ 10,00",
		"R$ 15,00",
		"R$ 10,00",
		"R$ 10,00",
		"R$ 26,00",
		"R$ 25,00",
		"R$ 26,00",
		"R$ 4,00",
		"R$ 30,00",
		"R$ 23,00",
		"R$ 26,00",
		"R$ 7,00",
		"R$ 23,00",
		"R$ 12,00"
		};


	private OnClickListener casaListener = new OnClickListener() {

		public void onClick(View v) {
			setResult(RESULT_OK);
			finish();
		}
	};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.comida_bebida_view);

		ListView bebidaComidaListView = getListView();
		bebidaComidaListView.setAdapter(new ComidaBebidaAdapter(this, itens,
				precos));
		ImageView casa = (ImageView) findViewById(R.idComidaBebida.casa);
		casa.setOnClickListener(casaListener);

		setBackGround();		

	}

	/**
	 * Seta o Backgound na barra de título.
	 * 
	 */
	private void setBackGround() {

		RelativeLayout rl = (RelativeLayout) findViewById(R.idComidaBebida.relativeLayout01);
		ControleDeBackground.SetBarraSuperiorBackGround(
				getApplicationContext(), rl);

	}

}
